import requests
from jsonpath import jsonpath

# url = "https://apiauthpre.mall.crecgwm.com/oauth2/token?grant_type=client_credentials" headers = {
# "Content-Type":"application/x-www-form-urlencoded", "Authorization": "Basic
# ZWU2ODJiZDAtMTBiOC00ZmIzLTgyYmEtNGRjMDE1OWIyMjI2OjRmNWRkZWMwLTBlMzItNGZmMS1iZWM1LTRlNTE4ZmFmY2VhOA=="} res =
# requests.post(url, headers=headers) print(res.json()) token = jsonpath(res.json(),"$.access_token")[0] print(token)
#
#
# url = "https://apipre.mall.crecgwm.com/system-manage-sup/sysUser/generateToken"
# data = {
#     "compangyId": "bf34544c-f08b-4341-a03b-0b6f55c67da5",
#     "exp": "",
#     "target": "lidonghao"
# }
# headers = {
#     "Content-Type": "application/json",
#     "Authorization": f"Bearer {token}"
# }
# res = requests.get(url,params=data,headers=headers)
# print(res)
# token = jsonpath(res.json(),"$.token")
# print(token)
from openai import OpenAI
import requests

client = OpenAI(api_key="sk-5a9bf680b5314db188198a7000c30c11", base_url="https://chat.deepseek.com/")

response = client.chat.completions.create(
    model="deepseek-chat",
    messages=[
        {"role": "system", "content": "You are a helpful assistant"},
        {"role": "user", "content": "Hello"},
    ],
    stream=False
)


print(response.choices[0].message.content)




